import xml.dom.minidom as xmldom
from Code.XmlDataManager import XmlDataManager


def parse_xml(patj):
    xml_file = xmldom.parse(patj)
    eles = xml_file.documentElement
    files = eles.getElementsByTagName("File")
    for i in range(0, len(files)):
        type = files[i].getElementsByTagName("Type")
        type = type[0].firstChild.data
        path = files[i].getElementsByTagName("Path")
        path = path[0].firstChild.data
        #print("type: ", type, "path: ", path)
        XmlDataManager._instance.push_data(path,type)